import mysql from 'mysql';
//1.创建链接池
let pool=mysql.createPool(require("./../dbconfig"));
function query(sql,params,callback) {
	pool.getConnection(function(err,conn){
        //conn 链接对象
        if(!err){
            conn.query(sql,params,callback);
            conn.release();
        }else{
        	callback(err,null,null);
        }
	})
}

module.exports={query}; //进行暴露